/**
 * 整个项目中会用到的一些常量定义
 */
// 后端接口环境定义，除了封装的request方法会用到之外，某些uni的网络请求API(如uploadFile)也会用到，此时不易于使用uni.request封装
//多个小程序api
/**
 * 新增appid一定要去相应的定制页面增加相应路径的页面phone_login、my
 * 具体增加模式请参考phone_login文件夹
 */
// #ifdef APP-PLUS
export const APP_NAME = "dlzj" // 汇租机
export const APP_APPID = "KSG1723860584372" //汇租机
// #endif

// #ifdef H5
export const APP_NAME = "dlzj" //汇租机
export const APP_APPID = "KSG1723860584372" //汇租机
// #endif



// #ifdef H5 || APP-PLUS
export const APP_NAME_DICT = {
	dlzj: '汇租机',
}
console.warn(`当前App为: ${APP_NAME}(${APP_NAME_DICT[APP_NAME]})`)
let _baseHost = "https://mobile.zuji.fun";
switch (APP_NAME) {
	case "dlzj":
		_baseHost = "https://mobile.zuji.fun";
		// _baseHost = "http://192.168.1.80:9092";
		break;
	default:
		_baseHost = "https://mobile.zuji.fun";
		break;
}
let _baseUrl = _baseHost + "/mall-api/" //超级商城
let _wssHost = 'wss:' + _baseHost.replace(/https?:/, '');
// #ifdef H5
if (process.env.NODE_ENV === 'development') {
	// _baseHost = "http://localhost:" + window.location.port
	// _baseUrl = _baseHost + "/mall-api/" //超级商城
	// _wssHost = 'ws://localhost:as' + window.location.port;
	// _baseUrl = "http://192.168.1.248:9092/mall-api/" //家和的
	// _baseUrl = "http://mobile.zuji.fun/mall-api/" 
	// _baseUrl = "https://zl-h5-53f1b6f8-272c-40c0-b035-a2e178b9b49d.dev-hz.cloudbaseapp-sandbox.cn/mall-api/" //掌心租
	// _baseUrl = "http://192.168.1.16:9092/mall-api/" //新宇的
	// _baseUrl = "http://192.168.1.25:9092/mall-api/" //zhan
	// _baseUrl = "https://testapi.chaorenshegou.com/mall-api/" //测试租赁
	// _baseUrl = "https://proapi.japalura.com/mall-api/" //生成租赁（龙隆的）
}
// #endif
export const baseHost = _baseHost;
export const wssHost = _wssHost;
export const baseUrl = _baseUrl;
// #endif

// #ifdef MP-ALIPAY
export const APP_NAME_DICT = {
	dlzj: '汇租机',
}
// console.warn(`当前App为: ${APP_NAME}(${APP_NAME_DICT[APP_NAME]})`)
let _baseHost = "https://mobile.zuji.fun";
switch (APP_NAME) {
	case "dlzj":
		_baseHost = "https://mobile.zuji.fun";
		break;
	default:
		_baseHost = "https://mobile.zuji.fun";
		// _baseHost = "https://proapi.zuji.fun";
		break;
}
let _baseUrl = _baseHost + "/mall-api/" //超级商城
let _wssHost = 'wss:' + _baseHost.replace(/https?:/, '');
if (process.env.NODE_ENV === 'development') {
	// _baseHost = "http://localhost:" + window.location.port
	_baseUrl = _baseHost + "/mall-api/" //超级商城
	// _wssHost = 'ws://localhost:' + window.location.port;
	// _baseUrl = "http://192.168.1.248:9092/mall-api/" //超级商城
}
export const baseHost = _baseHost;
export const wssHost = _wssHost;
export const baseUrl = _baseUrl;
// #endif

// 支付宝小程序端
// #ifdef MP-ALIPAY
// export const APP_APPID = "KSG1711097863349"
export const APP_NAME = "rich" //用rich调试
export const APP_APPID = my.getAppIdSync().appId
console.log('appid是多少', my.getAppIdSync().appId);
// #endif

// 微信小程序端
// #ifdef MP-WEIXIN
const accountInfo = wx.getAccountInfoSync();
export const APP_APPID = accountInfo.miniProgram.appId
// export const APP_APPID = "2021003136696039"
// #endif

// 新旧程序对照map
export const OLD_NEW_MAP = {
	1: "全新",
	2: "99新",
	3: "95新",
	4: "9成新",
	5: "8成新",
	6: "7成新",
	7: "96新",
	8: "97新",
	9: "98新"
}

//uni编译到各平台的运行环境
export const platformEnvList = [{
		uniCode: "web",
		paramCode: "h5",
	},
	{
		uniCode: "app",
		paramCode: "app",
	},
	{
		uniCode: "mp-alipay",
		paramCode: "alipay",
	},
	{
		uniCode: "mp-weixin",
		paramCode: "wechat",
	},
	{
		uniCode: "mp-toutiao",
		paramCode: "toutiao",
	}
]




// 空白文案的占位
export const EMPTY_PLACEHOLDER = "-"

export const ALL_ORDER_ID = "all"

export const ALL_ORDER_TEXT = "全部"


// 我的租赁订单中的所有菜单数据
export const TABS = [{
		id: ALL_ORDER_ID,
		extCode: "",
		text: ALL_ORDER_TEXT,
	},
	{
		id: "WAITING_PAYMENT",
		status: "01",
		text: "待付款",
	},
	// {
	// 	id: "PAYING",
	// 	status: "02",
	// 	text: "支付中",
	// },
	// {
	// 	id: "PAYED_USER_APPLY_CLOSE",
	// 	status: "03",
	// 	text: "已支付申请关单",
	// },
	{
		id: "PENDING_DEAL",
		status: "04",
		text: "待发货",
	},
	{
		id: "WAITING_USER_RECEIVE_CONFIRM",
		status: "05",
		text: "待收货",
	},
	{
		id: "RENTING",
		status: "06",
		text: "租用中",
	},
	// {
	// 	id: "RENTING",
	// 	status: "06",
	// 	text: "待完结",
	// },
	// {
	// 	id: "WAITING_SETTLEMENT",
	// 	status: "07",
	// 	text: "待结算",
	// },
	// {
	// 	id: "WAITING_SETTLEMENT_PAYMENT",
	// 	status: "08",
	// 	text: "结算待支付",
	// },
	{
		id: "FINISH",
		status: "09",
		text: "已完结",
	},
	{
		id: "CLOSED",
		status: "10",
		text: "已关闭",
	},
	// {
	// 	id: "TO_AUDIT",
	// 	status: "11",
	// 	text: "待审核",
	// },
	// {
	// 	id: "TO_GIVE_BACK",
	// 	status: "12",
	// 	text: "待归还",
	// },
	{
		id: "NO_SIGN",
		status: "13",
		text: "待签约",
	},
	// {
	// 	id: "ORDER_REFUSE",
	// 	status: "14",
	// 	text: "机审拒绝",
	// },
	// {
	// 	id: "NO_PAY_CLOSE",
	// 	status: "15",
	// 	text: "未支付申请关单",
	// },
]

//我的购买订单中的所有菜单数据
export const TABS_BUY = [{
		id: ALL_ORDER_ID,
		extCode: "",
		text: ALL_ORDER_TEXT,
	},
	{
		id: "WAITING_PAYMENT",
		status: "01",
		text: "待付款",
	},
	{
		id: "PENDING_DEAL",
		status: "04",
		text: "待发货",
	},
	{
		id: "WAITING_USER_RECEIVE_CONFIRM",
		status: "05",
		text: "待收货",
	},
	{
		id: "FINISH",
		status: "09",
		text: "订单完成",
	},
	{
		id: "CLOSED",
		status: "10",
		text: "交易关闭",
	},
]

//我的购买退还/售后订单中的所有菜单数据
export const TABS_BUY_SALE = [{
		id: "WAITING_PAYMENT",
		status: "1",
		text: "售后申请",
	},
	{
		id: "PENDING_DEAL",
		status: "3",
		text: "退货退款",
	},
	{
		id: "WAITING_USER_RECEIVE_CONFIRM",
		status: "4",
		text: "换货",
	},
	{
		id: "FINISH",
		status: "7",
		text: "已完成",
	},
	{
		id: "CLOSED",
		status: "5",
		text: "拒绝",
	},
]


// 运费对照对照表
export const freightTypeObj = {
	FREE: "包邮",
	PAY: "到付",
	SELF: "自提",
}

// tab导航
export const tabsDetails = ["商品详情"]
export const tabsDetails1 = ["商品详情"]
export const 待付款 = "01"
export const 支付中 = "02"
export const 已支付申请关单 = "03"
export const 待发货 = "04"
export const 待收货 = "05"
export const 待完结 = "06"
export const 待结算 = "07"
export const 结算待支付 = "08"
export const 已完结 = "09"
export const 已关闭 = "10"
export const 待审核 = "11"
export const 待归还 = "12"
export const 待签约 = "13"
export const 机审拒绝 = "14"
export const 取消订单 = "15"


export const orderStatusNumber2Cn = {
	[待付款]: "待付款",
	[支付中]: "支付中",
	[已支付申请关单]: "已支付申请关单",
	[待发货]: "待发货",
	[待收货]: "待收货",
	[待完结]: "待完结",
	[待结算]: "待结算",
	[结算待支付]: "结算待支付",
	[已完结]: "已完结",
	[已关闭]: "已关闭",
	[待审核]: "待审核",
	[待归还]: "待归还",
	[待签约]: "待签约",
	[机审拒绝]: "待审核",
	[取消订单]: "取消订单",
}


export const orderStatusDesc = {
	[待付款]: {
		title: "待付款",
		desc1: "",
		desc2: "如有疑问，请联系客服",
		img: "/static/orderList/icon_wait.png"
	},
	[待签约]: {
		title: "等待签约",
		desc1: "请尽快签署合约",
		desc2: "如您在签署过程中遇到任何问题请联系客服",
	},
	[支付中]: {
		title: "等待付款",
		desc1: "",
		desc2: "如有疑问，请联系客服",
	},
	[已支付申请关单]: {
		title: "已申请关闭",
		desc1: "您的订单商家正在关闭中",
		desc2: "如有支付金额，将会在1-3个工作日原路退回",
	},
	[待发货]: {
		title: "待发货",
		desc1: "您的宝贝即将发货，请耐心等待",
		desc2: "如有疑问，请联系客服",
		img: "/static/orderList/icon_deliver.png"
	},
	[待收货]: {
		title: "待收货",
		desc1: "您的宝贝正在路上",
		desc2: "收货后有任何问题请联系客服",
		img: "/static/orderList/icon_receive.png"
	},
	[待完结]: {
		title: "待完结",
		desc1: "1号是您的商品金额结单日期",
		desc2: "记得按时还款，避免逾期哦",
		img: "/static/orderList/icon_finish.png"
	},
	[待结算]: {
		title: "等待结算",
		desc1: "请及时关注您的结算信息",
		desc2: "收货后有任何问题请联系客服",
	},
	[结算待支付]: {
		title: "等待结算",
		desc1: "请及时关注您的结算信息",
		desc2: "收货后有任何问题请联系客服",
	},
	[已完结]: {
		title: "已完结",
		desc1: "订单完成啦",
		desc2: "再次下单可联系客服获取熟客优惠券哦",
		img: "/static/orderList/icon_finish.png"
	},
	[已关闭]: {
		title: "已关闭",
		desc1: "您的订单已关闭",
		desc2: "如有支付金额，将会在1-3个工作日原路退回",
		img: "/static/orderList/icon_close.png"
	},
	[待审核]: {
		title: "审核中",
		desc1: "请耐心等待，预计在提交后24小时内完成审核",
		desc2: "如有疑问，请联系客服",
	},
	[待归还]: {
		title: "待归还",
		desc1: "您的宝贝该归还了",
		desc2: "如在归还的途中或想延期，请联系客服"
	},
	[机审拒绝]: {
		title: "待审核",
		desc1: "待审核",
		desc2: "如有疑问，请联系客服"
	},
	[取消订单]: {
		title: "取消订单",
		desc1: "您的订单未支付，已申请取消",
		desc2: "如想支付，请重新申请订单"
	}
}
// 小程序分享的配置数据
export const shareConfigObj = {
	title: "",
	desc: "信用免押租，游戏数码应有尽有",
	path: "pages/index/index",
}

// 归还运费的中英文对照
export const yunfeiReturnMap = {
	FREE: "用户支付",
	PAY: "商家承担"
}
/**
 * 存在全局的一些数据变量命名，注意这里随便加入的一些字符，可以避免同一个全局变量被重复使用
 */
export const billDetailGlobalKey = "billDetail_dsjakjqw1213"
export const sendbackPageProductGlobalKey = "sendbackPageProductGlobalKey_shjdslasjkjk12"
export const selectAddressObjKey = "selectAddressObjKey_89erer9"

// 中文虽low，但却最为直观
export const 待支付 = "1"
export const 逾期未支付 = "4"
export const 已支付 = "2"
export const 逾期已支付 = "3"
export const 部分还款 = "8"
export const 逾期部分还款 = "9"